package caip2022p.rcv5;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] inputs = scanner.nextLine().split(" ");
        String n = inputs[0];
        String m = inputs[1];
        
        int num1 = 0;
        int num2 = 1;
        
        for (int i = 0; i < n.length(); i++) {
        	//不常见用法“字符转换数值”
            num1 += Character.getNumericValue(n.charAt(i));
        }
        
        for (int i = 0; i < m.length(); i++) {
            num2 *= Character.getNumericValue(m.charAt(i));
        }
        
        if (num1 >= num2) {
            System.out.println(num1 + "" + num2);
        } else {
            System.out.println(num2 + "" + num1);
        }
    }
}